package de.klingbeil.hhc.client;

import com.google.inject.Inject;
import com.google.inject.Provider;

import de.klingbeil.hhc.client.controller.ApplicationActionBarController;
import de.klingbeil.hhc.client.controller.ApplicationEditorController;
import de.klingbeil.hhc.client.controller.ApplicationHeaderController;
import de.klingbeil.hhc.client.controller.ApplicationHeaderController.ApplicationHeaderView;
import de.klingbeil.hhc.client.controller.ApplicationInfoController;
import de.klingbeil.hhc.client.controller.ApplicationListController;
import de.klingbeil.hhc.client.widget.RootContainer;

public class ApplicationMainPage {

	@Inject
	Provider<ApplicationHeaderController> headerController;
	@Inject
	Provider<ApplicationInfoController> infoController;
	@Inject
	Provider<ApplicationEditorController> editorController;
	@Inject
	Provider<ApplicationListController> listController;
	@Inject
	Provider<ApplicationActionBarController> actionBarController;
	@Inject
	RootContainer rootContainer;

	public void render() {
		ApplicationHeaderView view = headerController.get().getView();
		rootContainer.setHeaderView(view.getWidget(), view.getHeaderHeight());
		rootContainer.setActionBarView(actionBarController.get().getView().getWidget());
		rootContainer.setEditorView(editorController.get().getView()
				.getWidget());
		rootContainer.setListView(listController.get().getView().getWidget());
		rootContainer.setInfoView(infoController.get().getView().getWidget());
	}

}
